package com.rc.saas.mini.service.rc;

import com.rc.saas.mini.mapper.rc.RcEnterpriseGainGradeRecordMapper;
import com.rc.saas.mini.model.rc.RcEnterpriseGainGradeRecord;
import com.rc.saas.mini.model.rc.RcEnterpriseGainGradeRecordExample;
import com.rc.saas.mini.model.rc.RcEnterpriseGainRecordExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RcEnterpriseGainGradeRecordServiceImpl implements RcEnterpriseGainGradeRecordService {
    @Autowired
    private RcEnterpriseGainGradeRecordMapper rcEnterpriseGainGradeRecordMapper;

    @Override
    public RcEnterpriseGainGradeRecordMapper getMapper() {
        return rcEnterpriseGainGradeRecordMapper;
    }

    @Override
    public List<RcEnterpriseGainGradeRecord> listCurrentByMemberId(Long memberId) {
        RcEnterpriseGainGradeRecordExample example = new RcEnterpriseGainGradeRecordExample();
        example.createCriteria().andMemberIdEqualTo(memberId);
        example.setOrderByClause("created_time desc");
        return rcEnterpriseGainGradeRecordMapper.selectByExample(example);
    }

    @Override
    public List<RcEnterpriseGainGradeRecord> listCurrentByEnterpriseId(Long enterpriseId) {
        RcEnterpriseGainGradeRecordExample example = new RcEnterpriseGainGradeRecordExample();
        example.createCriteria().andEnterpriseIdEqualTo(enterpriseId);
        example.setOrderByClause("created_time desc");
        return rcEnterpriseGainGradeRecordMapper.selectByExample(example);
    }
}
